The pair approximation is a simple, low-order method to incorporate effectsof local spatial structure in epidemiological models. However, since for Kstate variables in a model there are K(K+1)/2 equations in the pairapproximation, generating these equations, although straightforward, can becometedious. In this paper we describe two programs written in Perl to simplifythis process - one to construct the equations, and the other to generateMatlab/Octave functions to numerically integrate the equations using apositivity-preserving method. A third utility program is also included whichgenerates a Maple file that can be used within the Maple symbolic manipulationprogram to simplify algebraically some of the terms in the generated filedescribing the equations, as well as to check that the usual combination ofequations sum up to zero, which is expected in cases where the total populationsizes are conserved.
展开▼